
// authPlugin.js
import store from './index';

export default (a) => {
  // 在页面刷新时，从localStorage恢复登录状态
  try {
    const userinfo = localStorage.getItem('userInfo_keji');
    console.log('--userinfo', userinfo, a)
    const _setUserinfo = JSON.parse(userinfo)
    if (_setUserinfo) {
      store.dispatch('getUserInfo', _setUserinfo)
    }
  } catch (error) {
    localStorage.setItem('userInfo_keji', null)
  }

};